package cn.tansanqinger.dao.sql.group;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import cn.tansanqinger.dao.sql.IGroupNumberSqlDao;
import cn.tansanqinger.pojo.Groupmember;

@Repository
public class GroupNumberSqlDaoImpl {

	@Autowired
	private IGroupNumberSqlDao dao;
	
	/**
	 * 查询群聊下面所有的对象
	 * @param gaccount
	 * @return
	 */
	public List<Groupmember> selectGroupAll(String gaccount) {
		QueryWrapper<Groupmember> queryWrapper = new QueryWrapper<Groupmember>();
		queryWrapper.lambda().eq(Groupmember::getGaccount, gaccount);
		return dao.selectList(queryWrapper);
	}
	
	/**
	 * 查询单一信息
	 * @param mid
	 * @return
	 */
	public Groupmember selectGroup(int mid) {
		return dao.selectById(mid);
	}
	
	/**
	 * 修改信息
	 * @param groupmember
	 * @return
	 */
	public int modification(Groupmember groupmember) {
		return dao.updateById(groupmember);
	}
}
